#ifndef LINUX_KEYVALUE_H
#define LINUX_KEYVALUE_H

#include <map>
using std::map;

#include <linux/input.h>

#include "keyvalue.h"

namespace keylog_linux {
	static map<unsigned short, keylog::KeyValue> createmap_keyvalue() {
		map<unsigned short, keylog::KeyValue> m;
		m[KEY_RESERVED] = keylog::value_reserved;
		m[KEY_ESC] = keylog::value_esc;
		m[KEY_1] = keylog::value_1;
		m[KEY_2] = keylog::value_2;
		m[KEY_3] = keylog::value_3;
		m[KEY_4] = keylog::value_4;
		m[KEY_5] = keylog::value_5;
		m[KEY_6] = keylog::value_6;
		m[KEY_7] = keylog::value_7;
		m[KEY_8] = keylog::value_8;
		m[KEY_9] = keylog::value_9;
		m[KEY_0] = keylog::value_0;
		m[KEY_MINUS] = keylog::value_minus;
		m[KEY_EQUAL] = keylog::value_equal;
		m[KEY_BACKSPACE] = keylog::value_backspace;
		m[KEY_TAB] = keylog::value_tab;
		m[KEY_Q] = keylog::value_q;
		m[KEY_W] = keylog::value_w;
		m[KEY_E] = keylog::value_e;
		m[KEY_R] = keylog::value_r;
		m[KEY_T] = keylog::value_t;
		m[KEY_Y] = keylog::value_y;
		m[KEY_U] = keylog::value_u;
		m[KEY_I] = keylog::value_i;
		m[KEY_O] = keylog::value_o;
		m[KEY_P] = keylog::value_p;
		m[KEY_LEFTBRACE] = keylog::value_leftbrace;
		m[KEY_RIGHTBRACE] = keylog::value_rightbrace;
		m[KEY_ENTER] = keylog::value_enter;
		m[KEY_LEFTCTRL] = keylog::value_leftctrl;
		m[KEY_A] = keylog::value_a;
		m[KEY_S] = keylog::value_s;
		m[KEY_D] = keylog::value_d;
		m[KEY_F] = keylog::value_f;
		m[KEY_G] = keylog::value_g;
		m[KEY_H] = keylog::value_h;
		m[KEY_J] = keylog::value_j;
		m[KEY_K] = keylog::value_k;
		m[KEY_L] = keylog::value_l;
		m[KEY_SEMICOLON] = keylog::value_semicolon;
		m[KEY_APOSTROPHE] = keylog::value_apostrophe;
		m[KEY_GRAVE] = keylog::value_grave;
		m[KEY_LEFTSHIFT] = keylog::value_leftshift;
		m[KEY_BACKSLASH] = keylog::value_backslash;
		m[KEY_Z] = keylog::value_z;
		m[KEY_X] = keylog::value_x;
		m[KEY_C] = keylog::value_c;
		m[KEY_V] = keylog::value_v;
		m[KEY_B] = keylog::value_b;
		m[KEY_N] = keylog::value_n;
		m[KEY_M] = keylog::value_m;
		m[KEY_COMMA] = keylog::value_comma;
		m[KEY_DOT] = keylog::value_dot;
		m[KEY_SLASH] = keylog::value_slash;
		m[KEY_RIGHTSHIFT] = keylog::value_rightshift;
		m[KEY_KPASTERISK] = keylog::value_kpasterisk;
		m[KEY_LEFTALT] = keylog::value_leftalt;
		m[KEY_SPACE] = keylog::value_space;
		m[KEY_CAPSLOCK] = keylog::value_capslock;
		m[KEY_F1] = keylog::value_f1;
		m[KEY_F2] = keylog::value_f2;
		m[KEY_F3] = keylog::value_f3;
		m[KEY_F4] = keylog::value_f4;
		m[KEY_F5] = keylog::value_f5;
		m[KEY_F6] = keylog::value_f6;
		m[KEY_F7] = keylog::value_f7;
		m[KEY_F8] = keylog::value_f8;
		m[KEY_F9] = keylog::value_f9;
		m[KEY_F10] = keylog::value_f10;
		m[KEY_NUMLOCK] = keylog::value_numlock;
		m[KEY_SCROLLLOCK] = keylog::value_scrolllock;
		m[KEY_KP7] = keylog::value_kp7;
		m[KEY_KP8] = keylog::value_kp8;
		m[KEY_KP9] = keylog::value_kp9;
		m[KEY_KPMINUS] = keylog::value_kpminus;
		m[KEY_KP4] = keylog::value_kp4;
		m[KEY_KP5] = keylog::value_kp5;
		m[KEY_KP6] = keylog::value_kp6;
		m[KEY_KPPLUS] = keylog::value_kpplus;
		m[KEY_KP1] = keylog::value_kp1;
		m[KEY_KP2] = keylog::value_kp2;
		m[KEY_KP3] = keylog::value_kp3;
		m[KEY_KP0] = keylog::value_kp0;
		m[KEY_KPDOT] = keylog::value_kpdot;
		m[KEY_ZENKAKUHANKAKU] = keylog::value_zenkakuhankaku;
		m[KEY_102ND] = keylog::value_102nd;
		m[KEY_F11] = keylog::value_f11;
		m[KEY_F12] = keylog::value_f12;
		m[KEY_RO] = keylog::value_ro;
		m[KEY_KATAKANA] = keylog::value_katakana;
		m[KEY_HIRAGANA] = keylog::value_hiragana;
		m[KEY_HENKAN] = keylog::value_henkan;
		m[KEY_KATAKANAHIRAGANA] = keylog::value_katakanahiragana;
		m[KEY_MUHENKAN] = keylog::value_muhenkan;
		m[KEY_KPJPCOMMA] = keylog::value_kpjpcomma;
		m[KEY_KPENTER] = keylog::value_kpenter;
		m[KEY_RIGHTCTRL] = keylog::value_rightctrl;
		m[KEY_KPSLASH] = keylog::value_kpslash;
		m[KEY_SYSRQ] = keylog::value_sysrq;
		m[KEY_RIGHTALT] = keylog::value_rightalt;
		m[KEY_LINEFEED] = keylog::value_linefeed;
		m[KEY_HOME] = keylog::value_home;
		m[KEY_UP] = keylog::value_up;
		m[KEY_PAGEUP] = keylog::value_pageup;
		m[KEY_LEFT] = keylog::value_left;
		m[KEY_RIGHT] = keylog::value_right;
		m[KEY_END] = keylog::value_end;
		m[KEY_DOWN] = keylog::value_down;
		m[KEY_PAGEDOWN] = keylog::value_pagedown;
		m[KEY_INSERT] = keylog::value_insert;
		m[KEY_DELETE] = keylog::value_delete;
		m[KEY_MACRO] = keylog::value_macro;
		m[KEY_MUTE] = keylog::value_mute;
		m[KEY_VOLUMEDOWN] = keylog::value_volumedown;
		m[KEY_VOLUMEUP] = keylog::value_volumeup;
		m[KEY_POWER] = keylog::value_power;
		m[KEY_KPEQUAL] = keylog::value_kpequal;
		m[KEY_KPPLUSMINUS] = keylog::value_kpplusminus;
		m[KEY_PAUSE] = keylog::value_pause;
		m[KEY_KPCOMMA] = keylog::value_kpcomma;
		m[KEY_HANGUEL] = keylog::value_hanguel;
		m[KEY_HANJA] = keylog::value_hanja;
		m[KEY_YEN] = keylog::value_yen;
		m[KEY_LEFTMETA] = keylog::value_leftmeta;
		m[KEY_RIGHTMETA] = keylog::value_rightmeta;
		m[KEY_COMPOSE] = keylog::value_compose;
		m[KEY_STOP] = keylog::value_stop;
		m[KEY_AGAIN] = keylog::value_again;
		m[KEY_PROPS] = keylog::value_props;
		m[KEY_UNDO] = keylog::value_undo;
		m[KEY_FRONT] = keylog::value_front;
		m[KEY_COPY] = keylog::value_copy;
		m[KEY_OPEN] = keylog::value_open;
		m[KEY_PASTE] = keylog::value_paste;
		m[KEY_FIND] = keylog::value_find;
		m[KEY_CUT] = keylog::value_cut;
		m[KEY_HELP] = keylog::value_help;
		m[KEY_MENU] = keylog::value_menu;
		m[KEY_CALC] = keylog::value_calc;
		m[KEY_SETUP] = keylog::value_setup;
		m[KEY_SLEEP] = keylog::value_sleep;
		m[KEY_WAKEUP] = keylog::value_wakeup;
		m[KEY_FILE] = keylog::value_file;
		m[KEY_SENDFILE] = keylog::value_sendfile;
		m[KEY_DELETEFILE] = keylog::value_deletefile;
		m[KEY_XFER] = keylog::value_xfer;
		m[KEY_PROG1] = keylog::value_prog1;
		m[KEY_PROG2] = keylog::value_prog2;
		m[KEY_WWW] = keylog::value_www;
		m[KEY_MSDOS] = keylog::value_msdos;
		m[KEY_COFFEE] = keylog::value_coffee;
		m[KEY_DIRECTION] = keylog::value_direction;
		m[KEY_CYCLEWINDOWS] = keylog::value_cyclewindows;
		m[KEY_MAIL] = keylog::value_mail;
		m[KEY_BOOKMARKS] = keylog::value_bookmarks;
		m[KEY_COMPUTER] = keylog::value_computer;
		m[KEY_BACK] = keylog::value_back;
		m[KEY_FORWARD] = keylog::value_forward;
		m[KEY_CLOSECD] = keylog::value_closecd;
		m[KEY_EJECTCD] = keylog::value_ejectcd;
		m[KEY_EJECTCLOSECD] = keylog::value_ejectclosecd;
		m[KEY_NEXTSONG] = keylog::value_nextsong;
		m[KEY_PLAYPAUSE] = keylog::value_playpause;
		m[KEY_PREVIOUSSONG] = keylog::value_previoussong;
		m[KEY_STOPCD] = keylog::value_stopcd;
		m[KEY_RECORD] = keylog::value_record;
		m[KEY_REWIND] = keylog::value_rewind;
		m[KEY_PHONE] = keylog::value_phone;
		m[KEY_ISO] = keylog::value_iso;
		m[KEY_CONFIG] = keylog::value_config;
		m[KEY_HOMEPAGE] = keylog::value_homepage;
		m[KEY_REFRESH] = keylog::value_refresh;
		m[KEY_EXIT] = keylog::value_exit;
		m[KEY_MOVE] = keylog::value_move;
		m[KEY_EDIT] = keylog::value_edit;
		m[KEY_SCROLLUP] = keylog::value_scrollup;
		m[KEY_SCROLLDOWN] = keylog::value_scrolldown;
		m[KEY_KPLEFTPAREN] = keylog::value_kpleftparen;
		m[KEY_KPRIGHTPAREN] = keylog::value_kprightparen;
		m[KEY_F13] = keylog::value_f13;
		m[KEY_F14] = keylog::value_f14;
		m[KEY_F15] = keylog::value_f15;
		m[KEY_F16] = keylog::value_f16;
		m[KEY_F17] = keylog::value_f17;
		m[KEY_F18] = keylog::value_f18;
		m[KEY_F19] = keylog::value_f19;
		m[KEY_F20] = keylog::value_f20;
		m[KEY_F21] = keylog::value_f21;
		m[KEY_F22] = keylog::value_f22;
		m[KEY_F23] = keylog::value_f23;
		m[KEY_F24] = keylog::value_f24;
		m[KEY_PLAYCD] = keylog::value_playcd;
		m[KEY_PAUSECD] = keylog::value_pausecd;
		m[KEY_PROG3] = keylog::value_prog3;
		m[KEY_PROG4] = keylog::value_prog4;
		m[KEY_SUSPEND] = keylog::value_suspend;
		m[KEY_CLOSE] = keylog::value_close;
		m[KEY_PLAY] = keylog::value_play;
		m[KEY_FASTFORWARD] = keylog::value_fastforward;
		m[KEY_BASSBOOST] = keylog::value_bassboost;
		m[KEY_PRINT] = keylog::value_print;
		m[KEY_HP] = keylog::value_hp;
		m[KEY_CAMERA] = keylog::value_camera;
		m[KEY_SOUND] = keylog::value_sound;
		m[KEY_QUESTION] = keylog::value_question;
		m[KEY_EMAIL] = keylog::value_email;
		m[KEY_CHAT] = keylog::value_chat;
		m[KEY_SEARCH] = keylog::value_search;
		m[KEY_CONNECT] = keylog::value_connect;
		m[KEY_FINANCE] = keylog::value_finance;
		m[KEY_SPORT] = keylog::value_sport;
		m[KEY_SHOP] = keylog::value_shop;
		m[KEY_ALTERASE] = keylog::value_alterase;
		m[KEY_CANCEL] = keylog::value_cancel;
		m[KEY_BRIGHTNESSDOWN] = keylog::value_brightnessdown;
		m[KEY_BRIGHTNESSUP] = keylog::value_brightnessup;
		m[KEY_MEDIA] = keylog::value_media;
		m[KEY_UNKNOWN] = keylog::value_unknown;
		return m;
	}
	static map<unsigned short, keylog::KeyValue> map_keyvalue = createmap_keyvalue();
}

#endif